<?php
/**
 * 教学计划
 * @author LXF
 * @date 2018.8.23
 */
namespace App\Http\Controllers\Crm;

use App\Http\Controllers\BaseController;
use App\Servers\Ajax;
use Illuminate\Http\Request;
use App\Model\Crm\TeachProgramModel;

class TeachProgramController extends BaseController {
    
    public function programlist(){
        $listinfo = TeachProgramModel::listProgram();
        dd($listinfo);
    }
    /***
     *添加教学计划 
     * lxf
     ***/
    public function add(Request $request) {
       // $a = $request->all();dd($a);exit;
        $user_id = addslashes($request->get('user_id'));
        $year   = addslashes($request->get('year'));
        $data = [
            ['user_id' => 1,
            'year' => '2018',
            'term' => '第一学期',
            'start_time' => time(),
            'end_time' => time(),
            'teach_plan'=> '发的说法是否打三分大赛',
            'teach_goals'=>'教学目标发放',
            'creat_at' => time()],
            ['user_id' => 2,
            'year' => '2018',
            'term' => '第一学期',
            'start_time' => time(),
            'end_time' => time(),
            'teach_plan'=> '发的说法是否打三分大赛',
            'teach_goals'=>'教学目标发放',
            'creat_at' => time()]
        ];
       
       $a  = TeachProgramModel::addProgram($data);
       echo $a;
       
    }
     /***
     *修改教学计划 
     * lxf
     ***/
    public function update() {
        $where['user_id'] =1;
        $data['term'] = '第二学期';        
        $res= TeachProgramModel::updateProgram($where,$data);
        echo $res;
    }
     /***
     *修改教学计划 
     * lxf
     ***/
    public function del() {
        $where['id'] =1;
        $data['is_del']=1;
        $res= TeachProgramModel::updateProgram($where,$data);
        echo $res;
    }
}
